<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人中心</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        .profile-header {
            background: linear-gradient(135deg, #4CAF50, #81C784);
            color: white;
            padding: 2rem 1rem;
            text-align: center;
            margin-bottom: 2rem;
        }
        .avatar {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background-color: white;
            color: #4CAF50;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            font-weight: bold;
            margin: 0 auto 1rem;
        }
        .card {
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            margin-bottom: 1.5rem;
            border: none;
        }
        .menu-item {
            padding: 1rem;
            border-bottom: 1px solid #eee;
            display: flex;
            align-items: center;
            color: #333;
            text-decoration: none;
            transition: all 0.3s;
        }
        .menu-item:hover {
            background-color: #f8f9fa;
        }
        .menu-item i {
            width: 30px;
            color: #4CAF50;
        }
    </style>
</head>
<body>
<!-- 顶部区域 -->
<div class="profile-header">
    <div class="avatar" th:text="${user.username.substring(0,1)}">张</div>
    <h3 th:text="${user.username}">张三</h3>
    <p class="text-white-50 mb-0" th:text="${user.email}">user@example.com</p>
</div>

<div class="container">
    <!-- 个人信息卡片 -->
    <div class="card">
        <div class="card-body">
            <h5 class="card-title"><i class="fas fa-id-card me-2"></i>个人信息</h5>
            <div class="row mt-3">
                <div class="col-md-6">
                    <p><strong>用户名:</strong> <span th:text="${user.username}">zhangsan</span></p>
                    <p><strong>性别:</strong> <span th:text="${user.gender ?: '未设置'}">男</span></p>
                </div>
                <div class="col-md-6">
                    <p><strong>生日:</strong> <span th:text="${user.birthday ?: '未设置'}">1990-01-01</span></p>
                    <p><strong>注册时间:</strong> <span th:text="${#dates.format(user.createTime, 'yyyy-MM-dd')}">2023-01-01</span></p>
                </div>
            </div>
            <a href="/profile/edit" class="btn btn-outline-primary mt-2">
                <i class="fas fa-edit me-1"></i>编辑信息
            </a>
        </div>
    </div>

    <!-- 账户设置菜单 -->
    <div class="card">
        <div class="card-body">
            <h5 class="card-title"><i class="fas fa-cog me-2"></i>账户设置</h5>
            <div class="list-group list-group-flush">
                <a href="/profile/change-password" class="list-group-item list-group-item-action">
                    <i class="fas fa-key me-2"></i>修改密码
                </a>
                <a href="#" class="list-group-item list-group-item-action">
                    <i class="fas fa-bell me-2"></i>通知设置
                </a>
                <a href="/logout" class="list-group-item list-group-item-action text-danger">
                    <i class="fas fa-sign-out-alt me-2"></i>退出登录
                </a>
            </div>
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>